<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            list-style: none;
        }

        .select {
            width: 100px;
            line-height: 30px;
            text-align: center;
            margin: 10px;
        }

        .select p {
            border: 1px solid #000;
        }

        .select ul {
            border: 1px solid #000;
            display: none;
        }

        .select li {
            border-bottom: 1px solid #000;
        }

        .select li:last-child {
            border: 0;
        }
    </style>
</head>

<body>

    <div class="select">
        <p>请选择</p>
        <ul>
            <li>湖北1</li>
            <li>湖北2</li>
            <li>湖北3</li>
            <li>湖北4</li>
        </ul>
    </div>

    <script>

        // p   li    document   都要绑定点击事件


        var oUl = document.querySelector('ul');

        // 事件委托的对象   document
        document.onclick = function (e) {

            // p 绑定事件
            if (e.target.tagName === 'P') {
                e.target.nextElementSibling.style.display = 'block';
                return;
            }

            // li绑定事件
            if (e.target.tagName === 'LI') {
                e.target.parentElement.previousElementSibling.innerHTML = e.target.innerHTML;
                // e.target.parentElement.style.display = 'none';
            }

            // 
            oUl.style.display = 'none';

        }

    </script>

</body>

</html>